using System;
using System.Diagnostics;
using System.Linq;
using data.contracts;

namespace generator
{
    public static class UsingsGenerator
    {
        public static string GenerateUsings(Board board) {
            Trace.TraceInformation("  Generate usings for board {0}", board.Name);
            if (board.Usings.IsEmpty()) {
                return "";
            }
            return board.Usings.Aggregate("", (current, @using) => current + GenerateUsing(@using));
        }

        private static string GenerateUsing(string @using) {
            return string.Format("using {0};{1}", @using, Environment.NewLine);
        }
    }
}